package com.open.capacity.forum.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author moonholder
 * @Description 文章表
 * @Date 15:06 2021/2/23
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Article implements Serializable {
    /**
     * 文章id，主键自增
     */
    @TableId(value = "arleid", type = IdType.AUTO)
    private Integer arleid;

    /**
     * 文章标题
     */
    private String atitle;

    /**
     * 文章内容
     */
    private String detail;

    /**
     * 作者（用户）id
     */
    @JsonSerialize(using= ToStringSerializer.class)
    private Long userid;

    /**
     * 文章类型（原创、转载、翻译）
     */
    private String artype;

    /**
     * 文章分类
     */
    private String catgry;

    /**
     * 文章标签
     */
    private String artags;

    /**
     * 文章点击数
     */
    private Integer arhits;

    /**
     * 文章点赞数
     */
    private Integer liknum;

    /**
     * 文章收藏数
     */
    private Integer cetnum;

    /**
     * 文章状态（草稿、发布）
     */
    private String astate;

    private String awcomt;

    /**
     * 数据状态1:正常 2:逻辑删除默认为1
     */
    @TableLogic(value = "1", delval = "2")
    private Boolean status;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date cretim;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updtim;

    private static final long serialVersionUID = 1L;
}

